package com.jindy.module.repairMachine.service.impl;

import java.util.List;
import com.jindy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jindy.module.repairMachine.mapper.RepairMachineMapper;
import com.jindy.module.repairMachine.domain.RepairMachine;
import com.jindy.module.repairMachine.service.IRepairMachineService;

/**
 * 报修机器管理Service业务层处理
 * 
 * @author jindy
 * @date 2023-04-25
 */
@Service
public class RepairMachineServiceImpl implements IRepairMachineService 
{
    @Autowired
    private RepairMachineMapper repairMachineMapper;

    /**
     * 查询报修机器管理
     * 
     * @param id 报修机器管理主键
     * @return 报修机器管理
     */
    @Override
    public RepairMachine selectRepairMachineById(Long id)
    {
        return repairMachineMapper.selectRepairMachineById(id);
    }

    /**
     * 查询报修机器管理列表
     * 
     * @param repairMachine 报修机器管理
     * @return 报修机器管理
     */
    @Override
    public List<RepairMachine> selectRepairMachineList(RepairMachine repairMachine)
    {
        return repairMachineMapper.selectRepairMachineList(repairMachine);
    }

    /**
     * 新增报修机器管理
     * 
     * @param repairMachine 报修机器管理
     * @return 结果
     */
    @Override
    public int insertRepairMachine(RepairMachine repairMachine)
    {
        repairMachine.setCreateTime(DateUtils.getNowDate());
        return repairMachineMapper.insertRepairMachine(repairMachine);
    }

    /**
     * 修改报修机器管理
     * 
     * @param repairMachine 报修机器管理
     * @return 结果
     */
    @Override
    public int updateRepairMachine(RepairMachine repairMachine)
    {
        repairMachine.setUpdateTime(DateUtils.getNowDate());
        return repairMachineMapper.updateRepairMachine(repairMachine);
    }

    /**
     * 批量删除报修机器管理
     * 
     * @param ids 需要删除的报修机器管理主键
     * @return 结果
     */
    @Override
    public int deleteRepairMachineByIds(Long[] ids)
    {
        return repairMachineMapper.deleteRepairMachineByIds(ids);
    }

    /**
     * 删除报修机器管理信息
     * 
     * @param id 报修机器管理主键
     * @return 结果
     */
    @Override
    public int deleteRepairMachineById(Long id)
    {
        return repairMachineMapper.deleteRepairMachineById(id);
    }
}
